<template>
  <view class="wrap">
    <u-cell-group>
      <u-cell :title="item" v-for="item in addrList" :isLink="true" :titleStyle="titleStyle" @click="() => selectAddr(item)"></u-cell>
	  </u-cell-group>
  </view>
</template>

<script>

export default {
  data() {
    return {
      addrList: [],
      titleStyle: {
        width: '100%',
        fontSize: '30rpx',
      }
    }
  },
  onLoad () {
    const { addr } = this.$store.state.userInfo;
    this.addrList = addr.split(',');
  },
  methods: {
    selectAddr(item) {
      const eventChannel = this.getOpenerEventChannel();
      eventChannel?.emit('selectAddr', item);
      uni.navigateBack();
    }
  },
}
</script>

<style lang="scss" scoped>
.wrap {
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  padding-bottom: 200rpx;
}
</style>
